import { get, post } from "./http.js";

let url = process.env.REACT_APP_BASE_URL;

//邮箱登录
export const emailLogin = (p) => post(url + "/user/login", p);
// 发送邮箱验证码
export const sendEmail = (p) => post(url + "/ems/send", p);
// 订阅
export const subscribe = (p) => post(url + "/user/subscribe", p);
// 用户信息
export const userInfo = (p) => post(url + "/user/info", p);
// 用户退出
export const userLogout = (p) => post(url + "/user/logout", p);
// 项目 - 项目列表
export const projectList = (p) => get(url + "/project/list", p);
// 项目 - 自选
export const projectChoose = (p) => post(url + "/project/choose", p);
// 项目 - 自选列表
export const projectMyList = (p) => get(url + "/project/myList", p);
//项目 - 自选周期
export const projectChoosePeriod = (p) => post(url + "/project/choosePeriod", p);
// 项目 - 项目详情
export const projectInfo = (p) => get(url + "/project/info", p);
// 消息 - 列表
export const messageList = (p) => get(url + "/message/list", p);
// 消息 - 已读
export const messageRead = (p) => post(url + "/message/read", p);
// 信号 - 历史信号
export const signalHistory = (p) => get(url + "/signal/history", p, 60000);
// 信号 - 历史回测
export const signalBackTest = (p) => get(url + "/signal/backtest", p);
// 用户 - 绑定Telegram
export const bindTelegram = (p) => post(url + "/user/bindTelegram", p,{timeout:90000});
// 用户 - 开关通知
export const switchNotify = (p) => post(url + "/user/notify", p);
// 用户 - 解除绑定Telegram
export const unbindTelegram = (p) => post(url + "/user/unbindTelegram", p);
// 用户 - 绑定钱包地址
export const bindWallet = (p) => post(url + "/user/bingWallet", p);
// 用户 - 钱包绑定签名信息
export const getBindNonce = (p) => get(url + "/user/getBindNonce", p);
// 用户 - 钱包登录签名信息
export const getNonce = (p) => get(url + "/user/getNonce", p);
// 信号 - 最新信号
export const signalNew = (p) => get(url + "/signal/new", p);
// 用户 - 钱包登录
export const walletLogin = (p) => post(url + "/user/walletLogin", p);
// 项目 - 搜索项目列表
export const projectSearchList = (p) => get(url + "/project/searchList", p);
// 订单 - 订单列表
export const orderList = (p) => get(url + "/order/list", p);
// 订单 - 创建订单
export const orderAdd = (p) => post(url + "/order/add", p);
// 订单 - 切换网络
export const switchNet = (p) => post(url + "/order/switchNet", p);
// 订单 - 查询是否支付完成
export const orderQuery = (p) => get(url + "/order/query", p);
// 订单 - 获取网络节点
export const getNet = (p) => get(url + "/order/getNet", p);
// 项目 - 项目k线
export const projectKLines = (p) => get(url + "/project/uiKlines", p, 60000);
// 用户 - 绑定邀请人
export const bindReferral = (p) => post(url + "/user/bindReferral", p);
// 信号 - 已读信号
export const signalRead = (p) => post(url + "/signal/read", p);
// 消息 - 未读数
export const messageUnRead = (p) => get(url + "/message/unRead", p);
































